package yijy.company;

import java.util.concurrent.TimeUnit;


/**
 * Created by yijy on 2017/5/4.
 */
public class DaemonsDontRunFinally {
    public static void main(String[] args) {
        Thread t = new Thread(new ADaemon());
        t.setDaemon(true);
        t.start();
    }
}

class ADaemon implements Runnable{

    @Override
    public void run() {
        try {
            System.out.println("start ADeamon");
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            System.out.println("InterruptedException");
        }finally {
            System.out.println("this should always run?");
        }
    }
}